import service from "@/utils/service";

// 获取供应商列表-分页
export const getSupplierPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopSupplier/page",
    method: "post",
    data
  });
};
// 获取供应商列表-不分页
export const getSupplierListApi = (data?: any) => {
  return service({
    url: "/xiechetong/xctRepairShopSupplier/list",
    method: "post",
    data
  });
};

// 添加供应商
export const addSupplierApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopSupplier/add",
    method: "put",
    data
  });
};

// 编辑供应商
export const editSupplierApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopSupplier/update",
    method: "post",
    data
  });
};
// 删除供应商
export const deleteSupplierApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopSupplier/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取入库单列表-分页
export const getPurchaseOrderPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctProductPurchaseOrder/page",
    method: "post",
    data
  });
};

// 新增入库单
export const addPurchaseOrderApi = (data: any) => {
  return service({
    url: "/xiechetong/xctProductPurchaseOrder/generate-purchase-order",
    method: "post",
    data
  });
};
